$("#submission").click(function () {
    var customerName = $("#customerName").val();
    var customerId = $("#customerId").val();
    var remarks = $("#remarks").val();
    if(remarks ==null || remarks ==""){
        alert("请输入备注！");
        return;
    };
    if (confirm("确定患者【" + customerName + "】要取消预约?")) {
        $.ajax({
            url: Feng.ctxPath + "/doctorLooked/cancelAppointmentok",
            type: "post",
            data: {
                customerId: customerId,
                remarks: remarks
            },
            success: function (data) {
                Feng.success('取消预约成功!');
                if(parent.$("#isDorj").val()=='dd'){ //到店详情
                    window.parent.location.href= Feng.ctxPath + '/consultant/to_openBileLists/' + customerId + "/1";
                    parent.layer.close(parent.layer.getFrameIndex(window.name));
                } else if(parent.$("#isDorj").val()=='ys'){ //医生
                    window.parent.location.href= Feng.ctxPath + '/doctorLooked/doctor_seeDiagnosis/' + customerId+'/1';
                    parent.layer.close(parent.layer.getFrameIndex(window.name));
                } else if(parent. $("#isDorj").val()=='st'){  //视图
                    parent.window.$('#calendar').fullCalendar('refetchEvents');
                    parent.layer.close(parent.layer.getFrameIndex(window.name));
                } else if(parent. $("#isDorj").val()=='tc'){  //TC
                    window.parent.location.href = Feng.ctxPath + '/consultantTwo/consultantToDetailByTab/' + customerId+'/4/0';
                    parent.layer.close(parent.layer.getFrameIndex(window.name));
                }
            },
            error: function (data) {
                alert('没有权限，请联系管理员!');
            }
        });
    };
});